package com.sq.partner.manager.dao;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import com.sq.partner.manager.mybatis.model.NlifeCoreProdRisk;
import com.sq.partner.manager.mybatis.model.NlifeCoreRisk;
import com.sq.partner.manager.mybatis.model.NlifeRisk;
import com.sq.partner.manager.util.Page;

/**
 *
 * @author zzGuo@2015-11-10 for new life
 *
 */
public interface INlifeRiskDao extends BaseDao{

	public Page<NlifeCoreProdRisk> queryCoreProdRiskTempletPageById(Page<NlifeCoreProdRisk> page, String coreProdCode, String prodCode, String riskCode, String riskName) throws Exception;

	public Page<NlifeRisk> queryRiskPageByCriteria(Page<NlifeRisk> page, String prodCode) throws Exception;

	public boolean queryIsExistRiskPrimaryKeyByParams(NlifeRisk risk) throws Exception;

	public boolean saveRisk(NlifeRisk risk) throws Exception;

	public boolean updateRisk(NlifeRisk risk) throws Exception;
	public boolean updateMRisk(String prodCode,String tradRiskCode,Integer flag,String rationId) throws Exception;
	public boolean deleteRisk(NlifeRisk risk) throws Exception;

	public boolean deleteRiskInfoByProdCode(String prodCode) throws Exception;
	/**产品导出险种*/
	public List<Map<String, Object>> impNlifeRisk(Map<String, Object>map)throws SQLException;
	/**判断是多主险产品还是单主险*/
	public Integer queryRiskType(Map<String, String> map)throws SQLException;

	public List<NlifeRisk> queryNlifeRiskByParam(Map<String,Object> map)throws Exception;

	public boolean queryNlifeRiskIsExits(NlifeRisk risk) throws Exception;
	//激活卡激活
	/**
	 * 根据投保方案，查询险种保额
	 * @param nlifePlanNO
	 * @return
	 * @throws Exception
	 */
	public List<Map<String,Object>> queryNlifeRiskAmt(String nlifePlanNo) throws Exception;

	/***/

	public Integer queryMainRiskCount(String prodCode) throws Exception;

	public List<NlifeRisk> queryMainRisk(String prodCode) throws Exception;

	public NlifeRisk queryFirstRisk(String prodCode) throws Exception;

}
